{% extends '@WebProfiler/Profiler/layout.html.twig' %}

{% block toolbar %}
  {% set icon %}
    {# this is the content displayed as a panel in the toolbar #}
    <span class="icon"><img src="/assets/img/default/apple.png" alt=""/></span>
    <span class="sf-toolbar-status">CloudApiLog</span>
  {% endset %}
  {% set text %}
    {# this is the content displayed when hovering the mouse over
       the toolbar panel #}
    <div class="sf-toolbar-info-piece">
      <b>Api Count</b>
      <span>{{ collector.count }}</span>
    </div>
  {% endset %}
  {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
{% endblock %}

{% block menu %}
  {# This left-hand menu appears when using the full-screen profiler. #}
  <span class="label">
        <span class="icon"><img src="/assets/img/default/apple.png" alt=""/></span>
        <strong>CloudApi</strong>
    </span>
{% endblock %}

{% block panel %}
  {# Optional, for showing the most details. #}
  <h2>CloudApi Logs <span style="color: brown">({{ collector.count }})</span></h2>
  {% for log in collector.logs %}
  <h4>{{ log.url }} {{ log.method }}</h4>
  <table>
    <tr>
      <th>RequestId</th><td>{{ log.requestId }}</td>
    </tr>
    <tr>
      <th>Method</th><td>{{ log.method }}</td>
    </tr>
    <tr>
      <th>Url</th><td>{{ log.url }}</td>
    </tr>
    <tr>
      <th>Params</th><td>{{ log.params|json_encode }}</td>
    </tr>
    <tr>
      <th>Headers</th><td>{{ log.headers|json_encode }}</td>
    </tr>
    <tr>
      <th>Results</th><td>{{ log.result|json_encode }}</td>
    </tr>
  </table>
  {% endfor %}
{% endblock %}